﻿using strange.extensions.context.api;
using UnityEngine;
using strange.extensions.context.impl;

public class DemoContext : MVCSContext 
{
	public DemoContext(MonoBehaviour view):base(view)
	{
		
	}

    protected override void mapBindings()
    {
        //model
		injectionBinder.Bind<ScoreModel> ().To<ScoreModel> ().ToSingleton();
        //view
		mediationBinder.Bind<BtnView> ().To<MediatorView> ();
        //command
		commandBinder.Bind (CommandEvent.RequsetScore).To<RequestScoreCommand> ();
		commandBinder.Bind (CommandEvent.UpdateScore).To<UpdateScoreCommand> ();
        //service
		injectionBinder.Bind <IScoreService>().To<ScoreService> ().ToSingleton();
        //创建一个StartCommand 启动strangeioc
		commandBinder.Bind(ContextEvent.START).To<StartCommand>().Once ();
    }
}
